package com.nan.buy.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nan.buy.model.OrderDetails;
import com.nan.buy.service.OrderDetailsService;

/**
 * 订单详细信息
 * @author 孙楠楠
 *
 */
@Controller
@RequestMapping("orderDetails")
public class OrderDetailsController {
	

	@Resource
	private OrderDetailsService orderDetailsService;
	

	/*
	 * 查詢某個訂單詳細信息
	 */
	@RequestMapping("search/orderDetails")
	@ResponseBody
	public List<OrderDetails> searchOrderDetailsByOrderId(String orderId){
		return orderDetailsService.searchOrderDetailsByOrderId(orderId);
	}

	/*
	 * 刪除某條訂單
	 */
	@RequestMapping("del")
	@ResponseBody
	public Object delOrderDetails(String id){
		int msg=orderDetailsService.deleteByPrimaryKey(id);
		return (msg != 0) ? true : false;
	}
}
